import { Injectable , NestInterceptor, CallHandler, Param } from "@nestjs/common";
import { map } from "rxjs";
import { Observable } from "rxjs";

interface Data<T>{
  data: T,
}
@Injectable()
export class MyResponse<T> implements NestInterceptor{
  intercept(context,next:CallHandler):Observable<Data<T>> {
    return next.handle().pipe(map(data => {
      return {
        data,
        status: 0,
        message: "牛逼",
        success:true
      }
    }))
  }
}